package demo;

class Animals{
    public String name;
    public int age;
    public String sex;
    static{
        System.out.println("Animals::static{}");
    }

    {
        System.out.println("Animals::{}");
    }
    public Animals(){
        System.out.println("Animals()");
    }

}
class Cat extends Animals{
    static{
        System.out.println("Cat::static{}");
    }
    public Cat(){
        System.out.println("Cat()");
    }

    {
        System.out.println("Cat::{}");
    }

}
public class Dog extends Animals {
    public String name;
    public int age;

    static{
        System.out.println("Dog::static{}");
    }
    public Dog(){
        System.out.println("Dog()");
    }

    {
        System.out.println("Dog::{}");
    }


    public static void main(String[] args) {

        Dog dog = new Dog();
        Cat cat = new Cat();

    }
}
